part of 'widget.dart';

class _AppMarkdownTextFieldView extends StatelessWidget {
  const _AppMarkdownTextFieldView({
    required this.markdown,
    this.width,
    this.maxLines,
  });

  final String markdown;
  final double? width;
  final int? maxLines;

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      padding: const EdgeInsets.symmetric(
        vertical: 11,
        horizontal: 13,
      ),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(10),
        color: _AppMarkdownTextFieldTheme.of(context).textFieldBackgroundColor,
        border: Border.all(
          color: _AppMarkdownTextFieldTheme.of(context).textFieldBorderColor,
          width: 0.7,
          strokeAlign: BorderSide.strokeAlignInside,
        ),
      ),
      child: buildMarkdown(
        markdown: markdown.isEmpty ? ' ' : markdown,
        textStyle: _AppMarkdownTextFieldTheme.of(context).textTheme.textField,
        markedTextStyle: _AppMarkdownTextFieldTheme.of(context).textTheme.textFieldBold,
        textAlign: TextAlign.start,
        textWidthBasis: TextWidthBasis.longestLine,
        maxLines: maxLines,
        selectable: true,
        context: context,
      ),
    );
  }
}
